package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bean.BuyerCarBean;
import com.project.bean.ProductBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IBuyCarMapper extends BaseMapper<BuyerCarBean> {
    @Select("SELECT b.*,p.* FROM t_buyerCar b,t_product p WHERE b.`fk_productId`=p.`pk_productId` AND b.`fk_userId`=#{userId}")
    @ResultMap("buyCarMap")
    List<BuyerCarBean> findByUserId(Integer userId);
}
